
const storage = window.localStorage
const site = {
  state: {
    data: {},
    service:[], // 我们的服务
  },
  getters: {
    service: state => {
      let data = JSON.parse(storage.getItem('service'))
      if (data) {
        state.service = data
      }
      return state.service
    },
  },
  mutations: {
    // 更新用户信息  userInfo  存储到浏览器缓存 写入登录状态
    updateServiceData(state, data) {
      state.service = data
      storage.setItem('service', data)
    },
  },
}

export default site
